package com.xiangban.rabbitMq;
import com.xiangban.dao.OrderMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author Mr. MaYaYun
 * @Data 2021/12/13 13:15
 */
@Component
@RabbitListener(queues = "delay_order_accompany_queue")
public class CancelOrderAccompanyReceiver {
    @Autowired
    private OrderMapper orderMapper;


    private static Logger LOGGER = LoggerFactory.getLogger(CancelOrderAccompanyReceiver.class);

    @RabbitHandler
    public void handle(String orderNo){
        orderMapper.updateAccompanyStatus(orderNo);
        LOGGER.info(orderNo+"此订单陪诊已拒绝接单");
    }
}

